<template>
  <div class="descriptions" v-if="show" :style="{ alignItems: alignItems }">
    <div class="label" :style="{ width: labelWidth }">
      {{ label }}<span v-if="separate">：</span>
    </div>
    <div class="value" :class="{ light: light }">
      {{ value }}<slot name="value"></slot>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  label: { type: String, default: '' },
  value: { type: [String, Number], default: '' },
  labelWidth: { type: [String, Number], default: '98px' },
  light: { type: Boolean, default: false },
  separate: { type: Boolean, default: true },
  show: { type: Boolean, default: true },
  alignItems: { type: String, default: 'center' },
})
</script>

<style lang="scss" scoped>
.descriptions {
  display: flex;
  font-size: 14px;
  font-weight: 400;

  margin: 12px 0;
  .label {
    text-align: right;
    font-size: 14px;
    font-weight: 400;
    color: #9da1ad;
    line-height: 20px;
  }
  .value {
    color: #3a4259;
    line-height: 20px;
    min-width: 268px;
    margin-right: 20px;
    &.light {
      color: #ff0000;
    }
  }
}
</style>
